﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using Iit.ITBI.MDSManager.Microsoft.MasterDataServices;

namespace Iit.ITBI.MDSManager
{

    [Serializable]
    class MDSException : System.Exception
    {

        #region needed for inheriting from base
        public MDSException()
        { }

        public MDSException(string message)
            : base(message)
        { }

        public MDSException(string message, Exception innerException)
            : base(message, innerException)
        { }

        protected MDSException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        { }
        #endregion

        public MDSException(string message, Exception innerException, MasterToSlaveEntityMapping MasterToSlaveEntityMapping)
            : base(message, innerException)
        {
            this.MasterToSlaveEntityMapping = MasterToSlaveEntityMapping;
        }

        public MDSException(string message, MasterToSlaveEntityMapping MasterToSlaveEntityMapping)
            : base(message)
        {
            this.MasterToSlaveEntityMapping = MasterToSlaveEntityMapping;
        }

        public MasterToSlaveEntityMapping MasterToSlaveEntityMapping
        {
            get;
            set;
        }


    }


    [Serializable]
    class InvalidSyncStateException : MDSException
    {
        
        #region needed for inheriting from base
        public InvalidSyncStateException()
        {}

        public InvalidSyncStateException(string message): base(message)
        {}
        
        public InvalidSyncStateException(string message, Exception innerException): base(message, innerException)
        {}

        public InvalidSyncStateException(string message, Exception innerException, MasterToSlaveEntityMapping MasterToSlaveEntityMapping)
            : base(message, innerException, MasterToSlaveEntityMapping)
        {}

        public InvalidSyncStateException(string message, MasterToSlaveEntityMapping MasterToSlaveEntityMapping)
            : base(message, MasterToSlaveEntityMapping)
        { }
                
        protected InvalidSyncStateException(SerializationInfo info, StreamingContext context): base(info, context)
        { }
        #endregion
    }



    [Serializable]
    class UnknownSyncStateException : MDSException
    {

        #region needed for inheriting from base
        public UnknownSyncStateException()
        { }

        public UnknownSyncStateException(string message)
            : base(message)
        { }

        public UnknownSyncStateException(string message, Exception innerException)
            : base(message, innerException)
        { }

        public UnknownSyncStateException(string message, Exception innerException, MasterToSlaveEntityMapping MasterToSlaveEntityMapping)
            : base(message, innerException, MasterToSlaveEntityMapping)
        {}

        public UnknownSyncStateException(string message, MasterToSlaveEntityMapping MasterToSlaveEntityMapping)
            : base(message, MasterToSlaveEntityMapping)
        { }

        protected UnknownSyncStateException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        { }
        #endregion
    }


    [Serializable]
    class NotSupportedQueryVersionException : MDSException
    {

        #region needed for inheriting from base
        public NotSupportedQueryVersionException()
        { }

        public NotSupportedQueryVersionException(string message)
            : base(message)
        { }

        public NotSupportedQueryVersionException(string message, Exception innerException)
            : base(message, innerException)
        { }

        public NotSupportedQueryVersionException(string message, Exception innerException, MasterToSlaveEntityMapping MasterToSlaveEntityMapping)
            : base(message, innerException, MasterToSlaveEntityMapping)
        {}

        public NotSupportedQueryVersionException(string message, MasterToSlaveEntityMapping MasterToSlaveEntityMapping)
            : base(message, MasterToSlaveEntityMapping)
        { }

        protected NotSupportedQueryVersionException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        { }
        #endregion
    }

    [Serializable]
    class InvalidMetadataException : MDSException
    {

        #region needed for inheriting from base
        public InvalidMetadataException()
        { }

        public InvalidMetadataException(string message)
            : base(message)
        { }

        public InvalidMetadataException(string message, Exception innerException)
            : base(message, innerException)
        { }

        public InvalidMetadataException(string message, Exception innerException, MasterToSlaveEntityMapping MasterToSlaveEntityMapping)
            : base(message, innerException, MasterToSlaveEntityMapping)
        {}

        public InvalidMetadataException(string message, MasterToSlaveEntityMapping MasterToSlaveEntityMapping)
            : base(message, MasterToSlaveEntityMapping)
        { }

        protected InvalidMetadataException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        { }
        #endregion
    }


    [Serializable]
    class InvalidMetadataCacheException : MDSException
    {

        #region needed for inheriting from base
        public InvalidMetadataCacheException()
        { }

        public InvalidMetadataCacheException(string message)
            : base(message)
        { }

        public InvalidMetadataCacheException(string message, Exception innerException)
            : base(message, innerException)
        { }

        public InvalidMetadataCacheException(string message, Exception innerException, MasterToSlaveEntityMapping MasterToSlaveEntityMapping)
            : base(message, innerException, MasterToSlaveEntityMapping)
        {}

        public InvalidMetadataCacheException(string message, MasterToSlaveEntityMapping MasterToSlaveEntityMapping)
            : base(message, MasterToSlaveEntityMapping)
        { }

        protected InvalidMetadataCacheException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        { }
        #endregion
    }

    [Serializable]
    class MDSMetadataCommandException : MDSException
    {

        #region needed for inheriting from base
        public MDSMetadataCommandException()
        { }

        public MDSMetadataCommandException(string message)
            : base(message)
        { }

        public MDSMetadataCommandException(string message, Exception innerException)
            : base(message, innerException)
        { }

        public MDSMetadataCommandException(string message, Exception innerException, MasterToSlaveEntityMapping MasterToSlaveEntityMapping)
            : base(message, innerException, MasterToSlaveEntityMapping)
        {}

        public MDSMetadataCommandException(string message, MasterToSlaveEntityMapping MasterToSlaveEntityMapping)
            : base(message, MasterToSlaveEntityMapping)
        { }

        protected MDSMetadataCommandException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        { }
        #endregion
    }

    [Serializable]
    class NotSupportedMappingStateException : MDSException
    {

        #region needed for inheriting from base
        public NotSupportedMappingStateException()
        { }

        public NotSupportedMappingStateException(string message)
            : base(message)
        { }

        public NotSupportedMappingStateException(string message, Exception innerException)
            : base(message, innerException)
        { }

        public NotSupportedMappingStateException(string message, Exception innerException, MasterToSlaveEntityMapping MasterToSlaveEntityMapping)
            : base(message, innerException, MasterToSlaveEntityMapping)
        {}

        public NotSupportedMappingStateException(string message, MasterToSlaveEntityMapping MasterToSlaveEntityMapping)
            : base(message, MasterToSlaveEntityMapping)
        { }

        protected NotSupportedMappingStateException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        { }
        #endregion
    }

    [Serializable]
    class UnknownMappingStateException : MDSException
    {

        #region needed for inheriting from base
        public UnknownMappingStateException()
        { }

        public UnknownMappingStateException(string message)
            : base(message)
        { }

        public UnknownMappingStateException(string message, Exception innerException)
            : base(message, innerException)
        { }

        public UnknownMappingStateException(string message, Exception innerException, MasterToSlaveEntityMapping MasterToSlaveEntityMapping)
            : base(message, innerException, MasterToSlaveEntityMapping)
        { }

        public UnknownMappingStateException(string message, MasterToSlaveEntityMapping MasterToSlaveEntityMapping)
            : base(message, MasterToSlaveEntityMapping)
        { }

        protected UnknownMappingStateException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        { }
        #endregion
    }

    [Serializable]
    class MemberValidationIssuesException : MDSException
    {

        #region needed for inheriting from base
        public MemberValidationIssuesException()
        { }

        public MemberValidationIssuesException(string message)
            : base(message)
        { }

        public MemberValidationIssuesException(string message, Exception innerException)
            : base(message, innerException)
        { }

        public MemberValidationIssuesException(string message, Exception innerException, MasterToSlaveEntityMapping MasterToSlaveEntityMapping)
            : base(message, innerException, MasterToSlaveEntityMapping)
        { }

        public MemberValidationIssuesException(string message, MasterToSlaveEntityMapping MasterToSlaveEntityMapping)
            : base(message, MasterToSlaveEntityMapping)
        { }

        protected MemberValidationIssuesException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        { }
        #endregion


        public MemberValidationIssuesException(string message, Exception innerException, MasterToSlaveEntityMapping MasterToSlaveEntityMapping, ValidationProcessResult ValidationProcessResult, ValidationIssue[] ValidationIssues)
            : base(message, innerException, MasterToSlaveEntityMapping)
        {
            this.ValidationProcessResult = ValidationProcessResult;
            this.ValidationIssues = ValidationIssues;
        }

        public MemberValidationIssuesException(string message, MasterToSlaveEntityMapping MasterToSlaveEntityMapping, ValidationProcessResult ValidationProcessResult, ValidationIssue[] ValidationIssues)
            : base(message, MasterToSlaveEntityMapping)
        {
            this.ValidationProcessResult = ValidationProcessResult;
            this.ValidationIssues = ValidationIssues;
        }

        public MemberValidationIssuesException(string message, ValidationProcessResult ValidationProcessResult, ValidationIssue[] ValidationIssues)
            : base(message)
        {
            this.ValidationProcessResult = ValidationProcessResult;
            this.ValidationIssues = ValidationIssues;
        }

        public ValidationIssue[] ValidationIssues
        {
            get;
            set;
        }

        public ValidationProcessResult ValidationProcessResult
        {
            get;
            set;
        }

    }


    [Serializable]
    class UsingSlaveEntityAsMasterException : MDSException
    {

        #region needed for inheriting from base
        public UsingSlaveEntityAsMasterException()
        { }

        public UsingSlaveEntityAsMasterException(string message)
            : base(message)
        { }

        public UsingSlaveEntityAsMasterException(string message, Exception innerException)
            : base(message, innerException)
        { }

        public UsingSlaveEntityAsMasterException(string message, Exception innerException, MasterToSlaveEntityMapping MasterToSlaveEntityMapping)
            : base(message, innerException, MasterToSlaveEntityMapping)
        { }

        public UsingSlaveEntityAsMasterException(string message, MasterToSlaveEntityMapping MasterToSlaveEntityMapping)
            : base(message, MasterToSlaveEntityMapping)
        { }

        protected UsingSlaveEntityAsMasterException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        { }
        #endregion
    }

}
